/*防止嵌入垃圾广告*/
var del_times = 0, deTimer = null;
function adGo() {
    var iframe = document.getElementsByTagName('iframe')[0];
    if(iframe){
        var bodyNode = {tagName:''}, iframeParent, targetNode = iframe.parentNode;
        while (bodyNode.tagName != 'BODY'){
            bodyNode = targetNode;
            if(bodyNode.tagName != 'BODY'){
                iframeParent = targetNode;
                targetNode = targetNode.parentNode;
            }
        }
        if(iframeParent){
            //如果iframe有父类
            bodyNode.removeChild(iframeParent);
        }else{
            //如果iframe没有父类
            var iframe=[];
            // 筛选出页面所有 iframe
            for(var i=0;i<bodyNode.childNodes.length;i++){
                if(bodyNode.childNodes[i].nodeName==="IFRAME"){
                    iframe.push(bodyNode.childNodes[i]);
                }
            }
            // 筛选出带有huakai_iframe类的iframe保留
            for(var j=0;j<iframe.length;j++){
                var className=iframe[j].className;
                if(className !== "huakai_iframe"){
                    bodyNode.removeChild(iframe[j]);
                }
            }
        }
    }
    del_times++;
    if (del_times > 10) window.clearInterval(deTimer)
}

//抢先 删除 嵌入广告
(function(){adGo();}())
deTimer = self.setInterval(adGo, 200);